package com.quyeying.utils.result;

import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.HashMap;
import java.util.Map;

/**
 * 分页返回数据公共类
 *
 * @author skx
 * @date 2019/10/22 11:00
 */
public class ReturnPageData {

    public static Map<String, Object> fillingData(IPage<?> page) {
        Map<String, Object> pageMap = new HashMap<>(3);
        pageMap.put("records", page.getRecords());
        pageMap.put("total", page.getTotal());
        pageMap.put("pages", page.getPages());
        return pageMap;
    }
}
